package com.atguigu.yygh.controller;


import com.atguigu.yygh.model.hosp.HospitalSet;
import com.atguigu.yygh.result.Result;
import com.atguigu.yygh.service.HospitalSetService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@Api(tags = "config测试接口")
@RestController
@RequestMapping("/admin/hosp/hospitalset")
public class HospitalSetController {

    @Autowired
    private HospitalSetService hospitalSetService;

    //1.查询所有医院的操作,
    @ApiOperation(value = "获取所有医院设置")
    @GetMapping("/findAll")
    public Result findAllHosptialSet(){
        List<HospitalSet> list = hospitalSetService.list();
        return Result.ok(list);
    }

    //5 根据id获取医院设置
    @ApiOperation(value = "根据id获取医院设置")
    @GetMapping("/getHospSet/{id}")
    public Result getHospSet(@PathVariable Long id) {
        HospitalSet hospitalSet = hospitalSetService.getById(id);
        return Result.ok(hospitalSet);
    }



}
